<template>
  <div class="assess-detail-info">
    <ul v-if="type == 1">
      <li>
        <span>企业名称</span>
        <span>{{ userInfo.industry }}</span>
      </li>
      <li>
        <span>联系人</span>
        <span>{{ userInfo.contactUser }}</span>
      </li>
      <li>
        <span>联系地址</span>
        <span>{{ userInfo.address }}</span>
      </li>
      <li>
        <span>开票名称</span>
        <span>{{ userInfo.billingName }}</span>
      </li>
      <li>
        <span>增值税登记号</span>
        <span>{{ userInfo.tagNo }}</span>
      </li>
      <li @click="companyAssess">
        <span>(管理员) 评价</span>
        <span>
          <i class="el-icon-remove-outline" style="font-size:20px"></i>
        </span>
      </li>
      <li>
        <span>操作</span>
        <span>
          <el-button size="mini" type="danger">删除</el-button>
          <el-button size="mini">禁用</el-button>
        </span>
      </li>
    </ul>

    <ul v-if="type == 2">
      <li>
        <span>企业名称</span>
        <span>{{ userInfo.name }}</span>
      </li>
      <li>
        <span>所属行业</span>
        <span>
          {{ userInfo.industry }}
        </span>
      </li>
      <li>
        <span>人员规模</span>
        <span>{{ userInfo.staffSize }}</span>
      </li>
      <li>
        <span>服务内容</span>
        <span>{{ userInfo.serviceContent }}</span>
      </li>
      <li>
        <span>服务产品</span>
        <span>{{ userInfo.serviceProduct }}</span>
      </li>
      <li>
        <span>企业LOGO</span>
        <span>
          <img :src="userInfo.logoUrl" alt="" />
        </span>
      </li>
      <li>
        <span>联系地址</span>
        <span>{{ userInfo.address }}</span>
      </li>
      <li @click="companyAssessSelf">
        <span>(管理员) 评价</span>
        <span>
          <i class="el-icon-remove-outline" style="font-size:20px"></i>
        </span>
      </li>
      <li>
        <span>操作</span>
        <span>
          <el-button size="mini" type="danger">删除</el-button>
          <el-button size="mini">禁用</el-button>
        </span>
      </li>
    </ul>

    <ul v-if="type == 3">
      <li>
        <span>姓名</span>
        <span>{{ userInfo.name }}</span>
      </li>
      <li>
        <span>照片</span>
        <span>
          <img :src="userInfo.photoUrl" alt="" />
        </span>
      </li>
      <li>
        <span>出生日期</span>
        <span>{{ userInfo.brithday }}</span>
      </li>
      <li>
        <span>学历</span>
        <span>{{ userInfo.education }}</span>
      </li>
      <li>
        <span>毕业院校</span>
        <span>{{ userInfo.graduatedFrom }}</span>
      </li>
      <li>
        <span>专业</span>
        <span>{{ userInfo.major }}</span>
      </li>
      <li>
        <span>服务方向</span>
        <span>{{ userInfo.serviceDirection }}</span>
      </li>
      <li>
        <span>从业经验</span>
        <span>{{ userInfo.industryExperience }}</span>
      </li>
      <li>
        <span>擅长领域</span>
        <span>{{ userInfo.expertise }}</span>
      </li>
      <li @click="companyAssessSelf">
        <span>(管理员) 评价</span>
        <span>
          <i class="el-icon-remove-outline" style="font-size:20px"></i>
        </span>
      </li>
      <li>
        <span>操作</span>
        <span>
          <el-button size="mini" type="danger">删除</el-button>
          <el-button size="mini">禁用</el-button>
        </span>
      </li>
    </ul>
  </div>
</template>

<script>
import { ReqUserInfoByUserId } from "../../../request";
export default {
  data() {
    return {
      userInfo: {},
      type: 0,
    };
  },
  methods: {
    companyAssess() {
      const query = this.$router.history.current.query;
      this.$router.push("/self/manage/companyAssess?company=" + query.id);
    },
    companyAssessSelf() {
      const query = this.$router.history.current.query
      this.$router.push("/self/manage/assessSelf?self=" + query.id);
    },
    assessSelf() {
      this.$router.push("/self/manage/assessSelf");
    },
  },
  async created() {
    const query = this.$router.history.current.query;
    console.log(query);
    const userData = await ReqUserInfoByUserId({ id: query.id });
    this.userInfo = userData.userInfo.userInfo;
    console.log(this.userInfo);
    this.type = query.type;
  },
};
</script>

<style scoped>
.assess-detail-info {
  width: 90%;
  margin: 0px auto;
}
.assess-detail-info ul li {
  height: 70px;
  line-height: 70px;
  border-bottom: 1px solid #efefef;
  display: flex;
}
li > :nth-child(n) {
  flex: 1;
}
li > :nth-child(2) {
  text-align: right;
}
</style>
